﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PBOfficeMaster.master" AutoEventWireup="true" CodeFile="StaffStructure .aspx.cs" Inherits="CommonInfoManager_StaffStructure_" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript" src="../js/ECOTree1.js"></script>
 <xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v"/>
		<style>v\:*{ behavior:url(#default#VML);}</style> 
<style type="text/css">
     .copy {
				font-family : "Verdana";				
				font-size : 10px;
				color : #CCCCCC;
			}
        .branchtop
        {
            margin: 10px 50px;
            text-align: left;
            font-size: 12px;
        }
        .lbBranch
        {
            font-size: 14px;
            font-weight: bold;
            background-image: url('../imges/daohangbeijing1.jpg');
            background-repeat: no-repeat;
            text-align: center;
            margin: 0;
            color: White;
            padding-top: 7px;
            height: 22px;
            width: 110px;
        }
        .btnBranch
        {
            width: auto;
            height: 20px;
            background-color: #ccffff;
            border: 1px solid #000099;
            color: #000099;
        }
        hr
        {
            height: 1px;
            margin-left: 45px;
            color: Blue;
            width: 804px;
        }
        .txt
        {
            border: 1px solid #6699FF;
            color: Blue;
        }
   </style>
   <script type="text/javascript">
       function xmlCreate() {
           if (window.ActiveXObject) {
               return new ActiveXObject("Microsoft.XMLHTTP");
           }
           else { return new XMLHttpRequest(); }
       }
       var myTree = null;
       window.onload = function returnDesk() {
           var xmlRequest = xmlCreate();
           xmlRequest.onreadystatechange = function () {
               if (xmlRequest.readystate == 4 && xmlRequest.status == 200) {

                   var desk = eval("(" + xmlRequest.responseText + ")");
                   myTree = new ECOTree('myTree', 'myTreeC');
                   myTree.config.colorStyle = ECOTree.CS_LEVEL;
                   myTree.config.selectMode = ECOTree.SL_NONE;
                   myTree.config.defaultNodeWidth = 120;
                   myTree.config.defaultNodeHeight = 50;
                   myTree.config.iSubtreeSeparation = 20;
                   myTree.config.iSiblingSeparation = 30;
                   myTree.config.iLevelSeparation = 30;
                   for (var i = 0; i < desk.length; i++) {
                       if (desk[i].SuperId == -1) {
                           myTree.add(desk[i].StfId, -1, desk[i].Position.PosName, desk[i].StfName, desk[i].StfCode, '', '', '', '', 'StaffInfo.aspx');
                       }
                       else {
                           myTree.add(desk[i].StfId, desk[i].SuperId, desk[i].Position.PosName, desk[i].StfName, desk[i].StfCode, '', '', '', '', 'StaffInfo.aspx');
                       }
                   }
                   myTree.UpdateTree();
               }
          }
           //3,初始化XMLrequest
           xmlRequest.open("POST", "Staff1.ashx", true);
           xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
           //4、发送请求
           xmlRequest.send();
           //            var data = "username" + document.getElementById("").value;
           //            xmlRequest.send(data);

       }
   </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div style="width: 864px; font-size: 14px;">
        <div class="branchtop">
            <table>
                <tr>
                    <td>
                        当前位置
                    </td>
                    <td>
                        <div class="lbBranch">
                            员工架构</div>
                    </td>
                </tr>
            </table>
        </div>
        <hr />
        <div id="myTreeC" style=" width:700px; text-align:center; height:300px;"></div>
    </div>
</asp:Content>

